package com.unitd.base.module.consumer.comm.util;

import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

/**
 * 自定义的与微信进行交互的X509TrustManager 新人管理器类
 *
 * @author hudan
 * @version 1.0
 * @filename MyX509TrustManager.java
 * @copyright www.unitd.com
 * @date 2020-07-01
 */
public class MyX509TrustManager implements X509TrustManager {

    /**
     * 检查客户端证书
     *
     * @param chain
     * @param authType
     * @throws CertificateException
     */
    @Override
    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
    }

    /**
     * 检查服务器端证书
     *
     * @param chain
     * @param authType
     * @throws CertificateException
     */
    @Override
    public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
    }

    /**
     * 返回受信任的X509证书数组
     *
     * @return
     */
    @Override
    public X509Certificate[] getAcceptedIssuers() {
        return null;
    }
}